package cn.didi.feidi.javabackend.server.waterdeliver.repository;

import cn.didi.feidi.javabackend.mysql.jpa.waterDeliver.WaterDeTo;
import cn.didi.feidi.javabackend.server.waterdeliver.constant.address.MysqlJpaHttpAddress;
import cn.didi.feidi.javabackend.server.waterdeliver.utils.UrlUtil;
import org.springframework.stereotype.Repository;
import org.springframework.web.client.RestTemplate;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by lindanpeng on 2017/7/17.
 */
@Repository
public class WaterDeToRep extends BaseRep<WaterDeTo>{

    public WaterDeTo getByWaterDeliverId(String waterDeliverId){
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("waterDeliverId", waterDeliverId);
        String path = "/WaterDeTo/getByWaterDeliverId";
        WaterDeTo waterDeTo = restTemplate.getForObject(UrlUtil.getServerURL(MysqlJpaHttpAddress.mysqlJpaHost, MysqlJpaHttpAddress.mysqlJpaPort, path, params),WaterDeTo.class);
        return waterDeTo;
    }



}
